{extend name='public/layer_base' /}
{block name='content'}
<div class="layui-fluid content">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-row">
                <form class="layui-form" method="post">

                    <div class="layui-form-item">
                        <label for="module" class="layui-form-label">作用模块</label>
                        <div class="layui-input-inline">
                            <select name="module" id="module" lay-search>
                                <option value="">请选择作用模块，默认整个项目</option>
                                <option value="app" {if isset($data) && $data.module=='app' }selected{/if}>app(整个项目)
                                </option>
                                {foreach name='module_list' id='item'}
                                <option value="{$item}" {if isset($data) && $data.module==$item}selected{/if}>{$item}
                                </option>
                                {/foreach}
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="name" class="layui-form-label">名称</label>
                        <div class="layui-input-inline">
                            <input id="name" name="name" value="{$data.name|default=''}" placeholder="请输入名称" required
                                lay-verify="required" type="text" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="description" class="layui-form-label">描述</label>
                        <div class="layui-input-inline">
                            <input id="description" name="description" value="{$data.description|default=''}"
                                placeholder="请输入描述" type="text" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="code" class="layui-form-label">代码</label>
                        <div class="layui-input-inline">
                            <input id="code" name="code" value="{$data.code|default=''}" placeholder="请输入代码" type="text"
                                class="layui-input">
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label for="sort_number" class="layui-form-label">排序</label>
                        <div class="layui-input-inline">
                            <div class="plus-minus">
                                <input id="sort_number" name="sort_number" value="{$data.sort_number|default='100'}"
                                    placeholder="请输入排序" type="number" data-minvalue="1" autocomplete="off"
                                    class="layui-input num">
                            </div>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label for="icon" class="layui-form-label">图标</label>
                        <div class="layui-input-inline">
                            <input maxlength="30" id="icon" name="icon" value="{$data.icon|default=''}"
                                class="layui-input " placeholder="请选择图标">
                        </div>
                    </div>
                    <script>
                        layui.use(['iconPickerFa', 'form', 'layer'], function () {
                            var iconPickerFa = layui.iconPickerFa,
                                form = layui.form,
                                layer = layui.layer,
                                $ = layui.$;
                            iconPickerFa.render({
                                // 选择器，推荐使用input
                                elem: '#icon',
                                // 数据类型：fontClass/awesome，推荐使用fontClass
                                // 数据类型：fontClass/awesome，推荐使用fontClass
                                url: "__ADMIN_PLUGINS__/font-awesome/less/variables.less",
                                // 是否开启搜索：true/false
                                search: true,
                                // 是否开启分页
                                page: true,
                                // 每页显示数量，默认12
                                limit: 12,
                                // 点击回调
                                click: function (data) {
                                    console.log(data);
                                },
                                // 渲染成功后的回调
                                success: function (d) {
                                    console.log(d);
                                }
                            });
                        });
                    </script>


                    <div class="layui-form-item">
                        <label for="auto_create_menu" class="layui-form-label">自动生成菜单</label>
                        <div class="layui-input-inline">
                            <input type="checkbox" name="auto_create_menu" lay-skin="switch" lay-text="是|否"
                                id="auto_create_menu" value="1" {if(isset($data) &&
                                $data.auto_create_menu==1)}checked{/if}>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="auto_create_file" class="layui-form-label">自动生成配置文件</label>
                        <div class="layui-input-inline">
                            <input type="checkbox" name="auto_create_file" lay-skin="switch" lay-text="是|否"
                                id="auto_create_file" value="1" {if(isset($data) &&
                                $data.auto_create_file==1)}checked{/if}>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="L_repass" class="layui-form-label"></label>
                        <button class="layui-btn" lay-filter="submit" id="submit" lay-submit="submit"
                            type="button">保存</button>
                        <button type="reset" class="layui-btn layui-btn-primary">
                            重置
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}